
package concept;

import java.io.Serializable;


public class Effect implements Serializable{
    public Effect(AspectModified attributeToModify, int value){
        this.attributeToModify = attributeToModify;
        this.value = value;
        temporary = false;
        this.times = Integer.MAX_VALUE;
        this.measure = Measure.COMBATS;
    }
    
    public Effect(AspectModified attributeToModify, int value, int times, Measure measure){
        this.attributeToModify = attributeToModify;
        this.value = value;
        temporary = true;
        this.times = times;
        this.measure = measure;
    }

    public int getValue(){
        return value;
    }

    public AspectModified getAttributeToModify(){
        return attributeToModify;
    }

    public int getTimes() {
    	if(temporary)
    		return times;
    	else
    		throw new IllegalStateException();
	}

	public Measure getMeasure() {
		if(temporary)
    		return measure;
    	else
    		throw new IllegalStateException();
	}
	
	public boolean getTemporary(){
		return temporary;
	}

	private int value, times;
	private Measure measure;
    private AspectModified attributeToModify;
    private boolean temporary;
    public enum Measure {COMBATS, TURNS;}
    private static final long serialVersionUID = 72235561078239L;
}
